<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="author" content="order by dede58.com"/>
    <title>用户注册</title>
    <link rel="stylesheet" type="text/css" href="../css/login.css">
</head>
<body>
    <div class="regist">
        <div class="regist_center">
            <div class="regist_top">
                <div class="left fl">评价</div>
                <div class="right fr"><a href="./index.html" target="_self">校园商城</a></div>
                <div class="clear"></div>
                <div class="xian center"></div>
            </div>
            <!--<div class="username">学&nbsp;&nbsp;&nbsp;&nbsp;号:&nbsp;<input id="schoolNumber" class="shurukuang" type="text" name="username"placeholder="请输入你的用户名"/></div>-->
            <!--&lt;!&ndash;<div class="username">学&nbsp;&nbsp;&nbsp;&nbsp;号:&nbsp;<input id="schoolNumber" class="shurukuang" type="text" name="username"placeholder="请输入你的学号"/></div>&ndash;&gt;-->
            <!--<div class="username">密&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;<input id="schoolPassword" class="shurukuang" type="password" name="password" placeholder="请输入你的密码"/></div>-->

            <div class="regist_main center">
              <div class="username">评&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:&nbsp;&nbsp;<input
                        id="remark" class="shurukuang" style="  width: 100%;height: 70px;"type="text" name="username" placeholder="填写用户评价"/><span></span>
                </div>

            </div>
            <div class="regist_submit" style="margin-top: 70px">
                <input  class="submit" onclick="sub()" type="submit" name="submit" value="提交评价">
            </div>

        </div>
    </div>

</body>
<script src="../js/crabapple.js" type="text/javascript"></script>
<script>
    function sub() {
        let remarkInfo = document.getElementById('remark').value

        let xmlhttpregister = new XMLHttpRequest();
        xmlhttpregister.onreadystatechange = function () {
            if (xmlhttpregister.readyState == 4 && xmlhttpregister.status == 200) {
                let re = JSON.parse(xmlhttpregister.responseText);
                console.log(re)
                if (re.success == true) {
                   alert(re.state)
                    window.location.href = './sellerCenter.html';
                }
                else alert(re.errMsg)
            }
        }
            xmlhttpregister.open("GET", prime_url + 'remark/addremark?' + 'userId=' + getCookie('userId') + '&sellerId=' + getCookie('sellerId') + '&remarkInfo=' + remarkInfo, true);
            xmlhttpregister.setRequestHeader('Content-Type', 'application/json')
            xmlhttpregister.send();
    }
</script>
</html>